/**
 * @Author yinyunqi
 * @date 2017年12月20日
 * @Content 登录控制
 */
package com.yongqi.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/login")
public class LoginController {
    //处理登录请求http://localhost:8080/login/login
    @RequestMapping("/login")
    public String doLogin() {
	return "login";
    }
    //处理注册请求http://localhost:8080/login/reg-family
    @RequestMapping("/regFamily")
    public String reg_family() {
	return "registerFamily";
    }
    @RequestMapping("/success")
    public String loginSuccess() {
	return "index";
    }
    //处理登录验证http://localhost:8080/login/verify
    @RequestMapping("/verify")
    public String doVerify(HttpServletRequest request) {
	System.out.println(request.getParameter("username"));
	if (request.getParameter("username").equals("1")) {
	    return "success";
	}
	else {
	    return "fail";
	}
    }
}

